package com.news.collect.controller;

import com.news.collect.common.CommonResult;
import com.news.collect.repository.SysUserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/health")
public class HealthController {
    @Autowired
    private SysUserRepository userRepository;

    @GetMapping("/")
    public CommonResult Health(){
        return CommonResult.success();
    }
    @GetMapping("/{id}")
    public CommonResult Health(@PathVariable String id) {
        SysUserRepository user =userRepository;
        user.getRoleIds();
        return CommonResult.success(id + "Healthy" );
    }
}
